﻿using System;
using System.Management.Automation.Host;

using Cognifide.PowerShell.Shell.Settings;

namespace Cognifide.PowerShell.Shell.Host
{
    public class ScriptingHostRawUserInterface : PSHostRawUserInterface
    {
        public ScriptingHostRawUserInterface()
        {
            BackgroundColor = PsConsoleSettings.Instance.BackgroundColor;
            ForegroundColor = PsConsoleSettings.Instance.ForegroundColor;
            CursorPosition = new Coordinates(0, 0);
            WindowPosition = new Coordinates(0, 0);
            CursorSize = 1;
            BufferSize = new Size(PsConsoleSettings.Instance.HostWidth, Int32.MaxValue);
            WindowSize = BufferSize;
        }

        public override KeyInfo ReadKey(ReadKeyOptions options)
        {
            throw new NotImplementedException();
        }

        public override void FlushInputBuffer()
        {
            throw new NotImplementedException();
        }

        public override void SetBufferContents(Coordinates origin, BufferCell[,] contents)
        {
            throw new NotImplementedException();
        }

        public override void SetBufferContents(Rectangle rectangle, BufferCell fill)
        {
            throw new NotImplementedException();
        }

        public override BufferCell[,] GetBufferContents(Rectangle rectangle)
        {
            throw new NotImplementedException();
        }

        public override void ScrollBufferContents(Rectangle source, Coordinates destination, Rectangle clip, BufferCell fill)
        {
            throw new NotImplementedException();
        }

        public override ConsoleColor ForegroundColor { get; set; }

        public override ConsoleColor BackgroundColor { get; set; }

        public override Coordinates CursorPosition { get; set; }

        public override Coordinates WindowPosition { get; set; }

        public override int CursorSize { get; set; }

        public override Size BufferSize { get; set; }

        public override Size WindowSize { get; set; }

        public override Size MaxWindowSize
        {
            get
            {
                return BufferSize;
            }
        }

        public override Size MaxPhysicalWindowSize
        {
            get
            {
                return BufferSize;
            }
        }

        public override bool KeyAvailable
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        public override string WindowTitle { get; set; }
    }
}
